// 风浪流专题图配置示例
export const windWaveCurrentConfigs = {
  // 风场配置示例
  windConfigs: {
    // 粒子模式配置
    particles: {
      showParticles: true,
      showArrows: false,
      showValues: false,
      particleDensity: 2,
      particleSpeed: 1.5,
      particleFadeOpacity: 0.95,
      particleMaxAge: 100,
      particleColorScale: 'wind',
      // 风场特有配置
      windSpeedRange: [0, 30], // m/s
      colorScheme: 'plasma'
    },
    
    // 箭头模式配置
    arrows: {
      showParticles: false,
      showArrows: true,
      showValues: false,
      arrowScale: 1.2,
      arrowSpacing: 40,
      arrowColor: '#ffffff',
      arrowStrokeWidth: 2,
      // 风场特有配置
      windSpeedRange: [0, 30],
      colorScheme: 'viridis'
    },
    
    // 数值模式配置
    values: {
      showParticles: false,
      showArrows: false,
      showValues: true,
      valuePrecision: 1,
      valueUnit: 'm/s',
      valueFontSize: 11,
      valueColor: '#000000',
      valueBackgroundColor: 'rgba(255,255,255,0.8)',
      valueSpacing: 80,
      // 风场特有配置
      windSpeedRange: [0, 30],
      colorScheme: 'default'
    },
    
    // 组合模式配置
    combined: {
      showParticles: true,
      showArrows: true,
      showValues: false,
      particleDensity: 1,
      particleSpeed: 1,
      arrowScale: 0.8,
      arrowSpacing: 60,
      arrowColor: '#ffffff',
      windSpeedRange: [0, 30],
      colorScheme: 'cool'
    }
  },

  // 海浪配置示例
  waveConfigs: {
    // 粒子模式配置
    particles: {
      showParticles: true,
      showArrows: false,
      showValues: false,
      particleDensity: 1.5,
      particleSpeed: 0.8,
      particleFadeOpacity: 0.96,
      particleMaxAge: 120,
      particleColorScale: 'wave',
      // 海浪特有配置
      waveHeightRange: [0, 8], // m
      colorScheme: 'ocean'
    },
    
    // 箭头模式配置
    arrows: {
      showParticles: false,
      showArrows: true,
      showValues: false,
      arrowScale: 1.0,
      arrowSpacing: 50,
      arrowColor: '#4ecdc4',
      arrowStrokeWidth: 1.5,
      // 海浪特有配置
      waveHeightRange: [0, 8],
      colorScheme: 'blues'
    },
    
    // 数值模式配置
    values: {
      showParticles: false,
      showArrows: false,
      showValues: true,
      valuePrecision: 2,
      valueUnit: 'm',
      valueFontSize: 10,
      valueColor: '#0066cc',
      valueBackgroundColor: 'rgba(255,255,255,0.9)',
      valueSpacing: 100,
      // 海浪特有配置
      waveHeightRange: [0, 8],
      colorScheme: 'default'
    },
    
    // 组合模式配置
    combined: {
      showParticles: true,
      showArrows: false,
      showValues: true,
      particleDensity: 1,
      particleSpeed: 0.6,
      valuePrecision: 1,
      valueUnit: 'm',
      valueFontSize: 9,
      valueSpacing: 120,
      waveHeightRange: [0, 8],
      colorScheme: 'turbo'
    }
  },

  // 海流配置示例
  currentConfigs: {
    // 粒子模式配置
    particles: {
      showParticles: true,
      showArrows: false,
      showValues: false,
      particleDensity: 2.5,
      particleSpeed: 2.0,
      particleFadeOpacity: 0.94,
      particleMaxAge: 80,
      particleColorScale: 'current',
      // 海流特有配置
      currentSpeedRange: [0, 2], // m/s
      colorScheme: 'jet'
    },
    
    // 箭头模式配置
    arrows: {
      showParticles: false,
      showArrows: true,
      showValues: false,
      arrowScale: 1.5,
      arrowSpacing: 35,
      arrowColor: '#45b7d1',
      arrowStrokeWidth: 2.5,
      // 海流特有配置
      currentSpeedRange: [0, 2],
      colorScheme: 'rainbow'
    },
    
    // 数值模式配置
    values: {
      showParticles: false,
      showArrows: false,
      showValues: true,
      valuePrecision: 2,
      valueUnit: 'm/s',
      valueFontSize: 10,
      valueColor: '#1a5490',
      valueBackgroundColor: 'rgba(255,255,255,0.85)',
      valueSpacing: 90,
      // 海流特有配置
      currentSpeedRange: [0, 2],
      colorScheme: 'default'
    },
    
    // 组合模式配置
    combined: {
      showParticles: true,
      showArrows: true,
      showValues: false,
      particleDensity: 1.5,
      particleSpeed: 1.5,
      arrowScale: 1.0,
      arrowSpacing: 45,
      arrowColor: '#45b7d1',
      currentSpeedRange: [0, 2],
      colorScheme: 'spectral'
    }
  }
};

// 预设组合配置
export const presetConfigs = {
  // 科学研究模式 - 高精度数值显示
  scientific: {
    wind: 'values',
    wave: 'values',
    current: 'values'
  },
  
  // 可视化展示模式 - 粒子效果
  visualization: {
    wind: 'particles',
    wave: 'particles',
    current: 'particles'
  },
  
  // 导航模式 - 箭头指示
  navigation: {
    wind: 'arrows',
    wave: 'arrows',
    current: 'arrows'
  },
  
  // 综合模式 - 组合显示
  comprehensive: {
    wind: 'combined',
    wave: 'combined',
    current: 'combined'
  }
};

// 颜色方案定义
export const colorSchemes = {
  wind: {
    plasma: ['#0d0887', '#46039f', '#7201a8', '#9c179e', '#bd3786', '#d8576b', '#ed7953', '#fb9f3a', '#fdca26', '#f0f921'],
    viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],
    cool: ['#00ffff', '#0080ff', '#0000ff', '#8000ff', '#ff00ff'],
    default: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffcc', '#fee090', '#fdae61', '#f46d43', '#d73027']
  },
  wave: {
    ocean: ['#000080', '#0000cd', '#4169e1', '#1e90ff', '#00bfff', '#87ceeb', '#b0e0e6', '#e0ffff'],
    blues: ['#08306b', '#08519c', '#2171b5', '#4292c6', '#6baed6', '#9ecae1', '#c6dbef', '#deebf7', '#f7fbff'],
    turbo: ['#30123b', '#4145ab', '#4675ed', '#39a2fc', '#1bcfd4', '#24eca6', '#61fc6c', '#a4fc3b', '#d1e834', '#f3c63a'],
    default: ['#2166ac', '#4393c3', '#92c5de', '#d1e5f0', '#f7f7f7', '#fddbc7', '#f4a582', '#d6604d', '#b2182b']
  },
  current: {
    jet: ['#000080', '#0000ff', '#0080ff', '#00ffff', '#80ff00', '#ffff00', '#ff8000', '#ff0000', '#800000'],
    rainbow: ['#9400d3', '#0000ff', '#00ff00', '#ffff00', '#ff7f00', '#ff0000'],
    spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],
    default: ['#053061', '#2166ac', '#4393c3', '#92c5de', '#d1e5f0', '#f7f7f7', '#fddbc7', '#f4a582', '#d6604d', '#b2182b', '#67001f']
  }
};

// 获取配置的辅助函数
export const getLayerConfig = (layerType, displayMode) => {
  const configs = {
    wind: windWaveCurrentConfigs.windConfigs,
    wave: windWaveCurrentConfigs.waveConfigs,
    current: windWaveCurrentConfigs.currentConfigs
  };
  
  return configs[layerType]?.[displayMode] || configs[layerType]?.particles;
};

// 获取预设配置的辅助函数
export const getPresetConfig = (presetName) => {
  return presetConfigs[presetName] || presetConfigs.visualization;
}; 